LL UTILS Functions

Delay management

group LL_Utils_Delay

Functions

void LL_InitTick ( uint32_t cpuclk_frequency , uint32_t ticks )

Configure the Cortex-M SysTick source of the time base.

Reference Manual to LL API cross reference (Register Field Functions)

SysTick_LOAD RELOAD LL_InitTick

SysTick_VAL CURRENT LL_InitTick

SysTick_CTRL CLKSOURCE LL_InitTick

SysTick_CTRL ENABLE LL_InitTick

Warning

When a RTOS is used, it is recommended to avoid changing the SysTick configuration by calling this function, for a delay use rather osDelay RTOS service.

Parameters :
  • cpuclk_frequency – CPU clock frequency in Hz

  • ticks – ticks frequency (unit: Hz), must be > 0

void LL_Init1msTick ( uint32_t cpuclk_frequency )

Configure the Cortex-M SysTick source to have a 1 ms time base.

Reference Manual to LL API cross reference (Register Field Functions)

SysTick_LOAD RELOAD LL_Init1msTick

SysTick_VAL CURRENT LL_Init1msTick

SysTick_CTRL CLKSOURCE LL_Init1msTick

SysTick_CTRL ENABLE LL_Init1msTick

Note

When a RTOS is used, it is recommended to avoid changing the Systick configuration by calling this function, for a delay use rather osDelay RTOS service.

Parameters :

cpuclk_frequency – CPU clock frequency (unit: Hz)

void LL_Delay_NoISR ( uint32_t delay_ms )

Provide a delay (in milliseconds) based on the SysTick counter flag.

Reference Manual to LL API cross reference (Register Field Functions)

SysTick_CTRL COUNTFLAG LL_Delay_NoISR

Note

Delay accuracy on the requested value is [0; +1 ms] due to uncertainty of the initial SysTick counter value compared to the reload value.

Note

To respect a 1 ms time base, call the LL_Init1msTick function which applies the appropriate SysTick configuration.

Warning

When using an RTOS, it is recommended to avoid changing the Systick configuration by calling this function; rather, use the osDelay RTOS service for delays.

Parameters :

delay_ms – Delay duration (unit: milliseconds)

Clock management

group LL_Utils_SystemClock

Functions

void LL_SetSystemCoreClock ( uint32_t cpuclk_frequency )

This function sets directly SystemCoreClock CMSIS variable.

Note

The variable can also be calculated through the “SystemCoreClockUpdate()” function.

Parameters :

cpuclk_frequency – CPU clock frequency (unit: Hz)